public class Demo {
    public static void main(String[] args) {
//		生成4位的验证码
        String random = ""+Math.random();
        String substring = random.substring(random.length()-4);
        System.out.println(substring);
    }
}
